home *** CD-ROM | disk | FTP | other *** search
- Path: cp.prima.ruhr.de!Diedrich_Vorberg
- Date: 17 Mar 1996 01:01:00 +0200
- From: Diedrich_Vorberg@cp.prima.ruhr.de (Diedrich Vorberg)
- Newsgroups: comp.lang.c++
- Message-ID: <650axk$dXdB@cp.prima.ruhr.de>
- References: <4ifajv$4n7s@uvaix3e1.comp.UVic.CA>
- Subject: Re: pointer questions
- X-Newsreader: CrossPoint v3.1
-
- Hello Colin !
-
- (Colin Gesy) hat neulich folgendes geschrieben:
- (Colin Gesy) wrote this a some time ago:
- > Could someone tell me if there is a difference
- > between the declaration "int *thing_ptr" and
- > "int* thing_ptr" ?
- > Also, what is the difference between "int& data"
- > and "int &data" ?
-
- There is no difference at all. What to write is rather a matter of taste.
-
- > What does the following statement do/mean? :
- >
- > ((searchItem&) *this)._refCount++; //searchItem is the class name
- >
-
- Er --- Ok, ok, ok....
- (searchItem&) is a typecaste.
- *this refes to the object the "this" pointer is pointing to (the current
- class)
- _refCount is a member of the class "searchItem", which is increased.
- The line
- ((searchItem*) this) -> _refCount ++;
- is doing the same thing: The type of "this" is changed and with a member
- of the new type is done something. The only thing the first version is
- doing more is, it makes a pointer apear as a reference.
-
- Hope, I could help you .. though I think I couldn't realy...
- Diedrich :-)
- --
- From me to you with love and in friendship !
- Internet: Diedrich_Vorberg@cp.prima.ruhr.de
- FIDO: 2:2444/4538.14 Point der KASIMIR BBS +49-2330-890348
- Bundespost: Diedrich Vorberg, Am Vorberg 12, 58300 Wetter
-